<template>
  <div>
    <div>
      <heads></heads>
        <div class="left">
          <left @id="getmysg"></left>
        </div>
        <div class="right">
          <div v-if="id==2">
            <Organization></Organization>
          </div>
          <div v-if="id==3">
            <userguanli></userguanli>
          </div>
          <div v-if="id==4">
            职务管理
          </div>
          <div v-if="id==5">
            岗位管理
          </div>
          <div v-if="id==7">
            <role_management></role_management>
          </div>
          <div v-if="id==8">
            <audit_user></audit_user>
          </div>
          <div v-if="id==9">
            菜单管理
          </div>
          <div v-if="id==11">
            角色授权
            <role_management></role_management>
          </div>
          <div v-if="id==12">
            角色授权
            <audit_user></audit_user>
          </div>
        </div>

    </div>
  </div>
</template>

<script>
import left from "@/components/left";
import heads from "@/components/heads";
import Organization from "@/components/Organization";
import userguanli from "@/components/userguanli";
import role_management from "@/components/role_management";
import audit_user from "@/components/audit_user";


export default {
  name: "unifode",
  data() {
    return {
      id: 2
    }
  },
  mounted() {
  if (localStorage.getItem('token')){
    return false
  }else {
    this.$router.push({path:'/login'})
  }
  },
  methods: {
    getmysg(id) {
      this.id = id
    }
  },
  components: {
    // 左边导航栏
    left: left,
    // 头部
    heads: heads,
    Organization: Organization,
    userguanli: userguanli,
    role_management: role_management,
    audit_user: audit_user,
  }

}
</script>

<style scoped>
.left{
  width: 20%;
  height: auto;
  /*auto自适应*/
  float:left;
  }
.right{
  width: 79%;
  height: auto;
  border: 1px solid beige;

  float:right;
}
</style>
